<?php
namespace Core\CoreComponents\AccountingManager;

/**
* This interface provide all accessible methods on Category module
*
* @method ServiceResponse getCategories($accountId)
* @method ServiceResponse getCategorie($accountName, $categoryName)
* @method ServiceResponse addCategory($accountName, $name, $parentId)
* @method ServiceResponse deleteCategory($id)
* @method ServiceResponse SynchronizeCategoriesToFolders($idAccount, $rootPath)
* @method ServiceResponse SynchronizeFoldersToCategories($idAccount, $rootPath)
* @method ServiceResponse getCategorieFromId($id)
*/
interface ICategories
{
	/**
	 * Get all categories from an account
	 * 
	 * @param integer $accountId The account id
	 *
	 * @return ServiceResponse This response contains all categories from the targeted account
	 */
    public function getCategories($accountId);
	
	/**
	 * Get category from an account and a name
	 * 
	 * @todo This method should take an account id instead of account name
	 * @param string $accountName The account name targeted
	 * @param string $categoryName The category name targeted
	 *
	 * @return ServiceResponse This response contains the targeted category from the selected account
	 */
    public function getCategorie($accountName, $categoryName);
	
	/**
	 * Add a category
	 * 
	 * @todo This method should take an account id instead of account name
	 * @param string $accountName The account name targeted
	 * @param string $name The category name
	 * @param string $parentId The parent category
	 *
	 * @return ServiceResponse This response contains the added category
	 */
    public function addCategory($accountName, $name, $parentId);
	
	/**
	 * Delete a category
	 *
	 * @param integer $id The category identifier
	 * 
	 * @return ServiceResponse The response contains the deleted category
	 */
    public function deleteCategory($id);
	
	/**
	 * Synchronize categories to folders
	 * 
	 * @param integer $idAccount The targeted account identifier
	 * @param string $rootPath The targeted root path to synchronize folders
	 *
	 * @return ServiceResponse The response contains a true boolean if success
	 */
    public function SynchronizeCategoriesToFolders($idAccount, $rootPath);
	
	/**
	 * Synchronize folders to categories
	 * 
	 * @param integer $idAccount The targeted account identifier
	 * @param string $rootPath The targeted root path to synchronize folders
	 *
	 * @return ServiceResponse The response contains a true boolean if success
	 */
    public function SynchronizeFoldersToCategories($idAccount, $rootPath);
	
	/**
	 * Get category form an id
	 *
	 * @param integer $id The category identifier
	 * 
	 * @return ServiceResponse The response contains the targeted category
	 */
    public function getCategorieFromId($id);
}

?> 